package logic

import (
	"context"
	"supp-man-sys/models/cache"
	"supp-man-sys/supprpc/internal/svc"
	"supp-man-sys/supprpc/supprpc"
	"time"

	"github.com/zeromicro/go-zero/core/logx"
)

type SendSmsLogic struct {
	ctx    context.Context
	svcCtx *svc.ServiceContext
	logx.Logger
}

func NewSendSmsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *SendSmsLogic {
	return &SendSmsLogic{
		ctx:    ctx,
		svcCtx: svcCtx,
		Logger: logx.WithContext(ctx),
	}
}

func (l *SendSmsLogic) SendSms(in *supprpc.SendSmsRequest) (*supprpc.SendSmsResponse, error) {
	// todo: add your logic here and delete this line

	SendSms := SendSmsLogic{
		ctx:    nil,
		svcCtx: nil,
		Logger: nil,
	}
	cache.RDB.Set(l.ctx, "sendsms"+in.Account, SendSms, time.Minute*3)

	return &supprpc.SendSmsResponse{}, nil
}
